<?php 
class MemberControl extends Control
{
    public function index()
    {
        $uid = $_SESSION['user']['uid'];
        $db = M();
        $sql = "SELECT * FROM hd_g_order AS od JOIN hd_g_order_list AS odl ON od.order_id=odl.goods_order_order_id WHERE od.user_uid=$uid";
        $data = $db->query($sql);
        $this->assign("data",$data);
        $this->display('member');
    }

    public function info()
    {
        if(IS_POST){
            // p($_POST);exit;
            if($_POST['passwordN']){
                $_POST['password'] = md5($_POST['passwordN']);
            }    
            $db = M('user');
            $db->where('uid='.$_POST['uid'])->save();
            $this->success('修改成功');
        }else{
            $db = M('user');
            $uid = $_SESSION['user']['uid'];
            $data = $db->where('uid='.$uid)->find();
            $this->assign('data',$data);
            $this->display(); 
        }
        
    }






}
















 ?>